/*
 * @Author: hejianbo
 * @Date: 2024-06-16 13:48:23
 * @LastEditors: hejianbo
 * @FilePath: /src/api/activity.js
 * @Description: 药企活动
 */
import request from "@/utils/request";

// 药企活动-授权人web-查询医药代表列表-分页
export function medicineUserPage(data) {
  return request({
    url: "/v2/system/medicine/company/activity/certigier/medicine/user/page",
    method: "POST",
    data,
  });
}

// 药企活动-医生导入模版
export function activityUserTemplate(type) {
  return request({
    url: `/v2/system/medicine/company/activity/user/template/${type}`,
    method: "GET",
  });
}

// 药企活动-授权人web-导入医药代表
export function activityMedicineUserImport(projectId, formData) {
  return request.post(`/v2/system/medicine/company/activity/certigier/import/${projectId}`, formData, {
    headers: { "Content-Type": "multipart/form-data" },
  });
}

// 省列表
export function getProvince() {
  return request({
    url: "/v2/system/adminOperating/hosptial/selProvince",
    method: "GET",
  });
}

// 市列表
export function getCity(id) {
  return request({
    url: "/v2/system/adminOperating/hosptial/selCity?provinceId=" + id,
    method: "GET",
  });
}

// 医药代表管理-修改有效状态
export function activityMedicineUserStatus(medicineUserId, status) {
  return request({
    url: `/v2/system/medicine/company/activity/medicine/user/status/${medicineUserId}/${status}`,
    method: "PUT",
  });
}

// 医药代表管理-新增
export function activityMedicineUserAdd(data) {
  return request({
    url: `/v2/system/medicine/company/activity/medicine/user/add`,
    method: "POST",
    data,
  });
}

// 医药代表管理-编辑
export function activityMedicineUserEdit(data) {
  return request({
    url: `/v2/system/medicine/company/activity/medicine/user/edit`,
    method: "PUT",
    data,
  });
}
